#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<random>
using namespace std;
mt19937 RAND(random_device{}());
int n,q;
int main()
{
	freopen("good.in","w",stdout);
	int l,r;
	//n=RAND()%7+1,q=RAND()%10+1;
	n=1000000,q=1000000;
	cout<<n<<' '<<q<<endl;
	for (int i=1;i<=n;++i) cout<<(RAND()&1);
	cout<<endl;
	while (q--)
	{
		l=RAND()%n+1,r=RAND()%n+1;
		if (l>r) swap(l,r);
		cout<<l<<' '<<r<<endl;
	}
	return 0;
}
